the process ID is as follows:
PS-C between D-f | grep between d | tr-s ''| cut-D''-F 2
Or
PS aux | grep rjd | grep-V "grep" | awk-F "" '{print $2 }'
B. Stop running the script
Run MongoDB-stop on the command line. 3 nodejs Service Management 3.1 about forever
Forever manages node. js backend operations, restarts, and stops service monitoring.Program. 3.2
NPM Install Local Packnpm install : This command creates the Node_modules directory in the current directory (if it does not already exist) and downloads the package to that directory. the command is installed locally by default. Which version of the software package is installed?If there is no Package.json file in the local directory, the latest version of the package is installed.If there is a Package.json file, install the latest version of the Sem
Forever
A simple CLI tool for ensuring that a given script runs continuously (I. e. Forever ).A very simple CLI tool for yourProgramContinuous operation.
Install forever: https://github.com/nodejitsu/forever
$ [Sudo] NPM install forev
Next, let's see if forever can achieve the goal.First, Forever Introduction
Forever is a simple command-nodejs daemon that can start, stop, and restart app apps. Forever is completely based on command line operation, under the Forever process, create node subprocess, monito
away.You can turn left or you can go ahead.But you can't stayDon't look around.There's no good in here.Don't wait for fantasies, not to expect them.No one sings here.No one can stop youThe thumbs up like a mountain and a solemn strongThe mountains hide your wish like a mother's callThat bowl of chickpeas bacon soupKeep jumping on your backpackDon't think about where you're going next.Blue Lake at the foot of the mountainTo give you peace and joyLit a campfire and warmed the fieldsClose your eye
time you change a file, it automatically restarts the service without having to restart it manually.
Install ForeverCopy code code as follows:Remember to add-g,forever requirements to install to the global environmentsudo npm install forever-gForever Use InstructionsStart relatedCopy code code as follows:1. Easy to startForever Start App.js
2. Specify
1. The following is the specific details of the error; Node 8.1.2 Issue: Other space installation succeeded but the installation Webpack always reported the following error: Workaround for reinstalling node
2.
NPM Module Manager
From the JavaScript standard reference tutorial (Alpha), by Nanyi directory introduction NPM init npm set
Nodejs is generally used as a user command execution, when the user disconnected customers, the use of the stop, very annoying. How to make Nodejs application as a service and execute it in the background?The simplest way:$ nohup node app.js However, forever can do more things, such as recording output and error logs separately, such as can be used as an API in JS.$ sudo npm install
What Is forever
Forever can be seen as a Nodejs daemon that can start, stop, and restart our app apps.The official note is that:
Copy Code code as follows:
A simple CLI tool to ensuring that a given script runs continuously (i.e. forever).
A simple command-line tool for continuing (or forever) running
Forever
Remember to add-g,forever requirements to install to the global environmentsudo npm install forever-g
Forever Use InstructionsStart related
1. Easy to startForever Start App.js
2. Specify forever information output fi
Can you solve the problem with forever and startup scripts? The answer, of course, is yes, it's just a bit of a hassle and forever the official lack of detailed configuration documentation. I also took some detours in the configuration, below in detail.
Note: The experimental environment of this article is the Ubuntu Server 12.04 LTS x86_64, the configuration of the CentOS is simpler
The earliest, I think
this way, and forever won't work, in desperation, it is still from/etc/init. d.
First of all, I would like to thank the author of this article, http://cnodejs.org/topic/5059ce39fd37ea6b2f07e1a3, which is really a few valuable materials!
The premise is that the forever should be good first, and the method is very simple. Just execute the following command:
npm in
be good first, and the method is very simple. Just execute the following command:
npm install forever -g
After the installation is complete, test it with a simple Node program:
forever start test.jsforever stop test.jsforever restart test.js
If no error is prompted, it indicates that forever can be used. That is t
following command is good:?
1
npm installforever -g
Once the installation is complete, test it with a simple node program:?
123
forever start test.jsforever stop test.jsforever restart test.js
As long as the error is not prompted, it indicates that forever is available, that is, to use
mongodb can run in this way, and forever won't work, in desperation, it is still from/etc/init. d.
First of all, I would like to thank the author of this article, http://cnodejs.org/topic/5059ce39fd37ea6b2f07e1a3, which is really a few valuable materials!
The premise is that the forever should be good first, and the method is very simple. Just execute the following command:
What is ForeverForever can be seen as a Nodejs daemon that can start, stop, and restart our app. The official note is that the following code is copied: A Simple CLI Tool forEnsuring that a given script runs continuously (i.e. forever).//a simple command-line tool for continuing (or forever) running a given scriptGitHub Address: Https://github.com/nodejitsu/foreverForever UseThe purpose of
It is not possible to manage a remote site directly through the node command, which makes it impossible to keep the site running. We use forever to solve this problem, it can be nodejs application of the way the daemon process, we can also set the Nodejs application to start with the system to run automatically.
First, install Forever:
Copy Code code as follows:
Foreverforever can keep the project running when cmd or SSH is disconnected, and can be restarted automatically when the project crashes? Install the NPM install-g forever?forever help manual Forever--help? Use forever to start a project
2. npm usage, npm usage
NPM is a package management tool installed along with NodeJS. It can solve many problems in NodeJS code deployment. Common use cases include:
Users are allowed to download third-party packages written by others from the NPM server for local use.
Allows users to download and install command li
First, NPM Introduction:NPM, called node Package Manager, is a node. JS-based pack manager and the most popular and supported third-party module in the entire node. JS community.Usage Scenarios for NPM:
Allows users to download third-party packages written by others from the NPM server for local use.
Allows users to download and install command-line
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.